
import Book.BookList;
import User.Admini;
import User.Control;
import User.User;

import java.util.Scanner;

//主操作
public class Main {
    public static Control login() {
        System.out.print("请输入你的姓名:>");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        System.out.print("请输入你的选择[1.管理员 0.用户]:>");
        int choice = scanner.nextInt();
        if (choice == 1) {
           return new Admini(name);
        }else {
            return new User(name);
        }
    }

    public static void main(String[] args) {
        BookList bookList = new BookList();
        Control control = login();
        while(true) {
            int ret = control.menu();
            control.work(ret,bookList);
        }

    }
}
